import mongoose from "mongoose";

const UserSchema = new mongoose.Schema(
  {
    userId: { type: Number, index: true, unique: true, required: true },
    firstName: { type: String },
    lastName: { type: String },
    username: { type: String },
    languageCode: { type: String },
    isBot: { type: Boolean },
    isPremium: { type: Boolean },
    createdAt: { type: Date },
    updatedAt: { type: Date },
  },
  { timestamps: { createdAt: true, updatedAt: true, currentTime: () => new Date() } },
);

export const User = mongoose.model("User", UserSchema);
